# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=miniupnpc
pkgver=2.1.20191224
pkgrel=1
pkgdesc="Library and tool to control NAT in UPnP-enabled routers"
url="http://miniupnp.free.fr"
arch="all"
license="BSD-3-Clause"
makedepends="bsd-compat-headers py3-setuptools python3-dev"
subpackages="$pkgname-dev py3-$pkgname:_py3 $pkgname-doc"
source="http://miniupnp.free.fr/files/$pkgname-$pkgver.tar.gz"

build() {
	make
	python3 setup.py build
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install
}

_py3() {
	pkgdesc="Python bindings for miniupnpc"
	depends="python3"
	cd "$builddir"
	python3 setup.py install --prefix=/usr --root="$subpkgdir" --skip-build
}

sha512sums="d362f914ce9177c1bc46f1f3ae59069c61c0c9c1b6ea7e78003d6b46445d3550835ffc541c2649b5fbc997d035357b461148edb3648135f33d0ce98b54961917  miniupnpc-2.1.20191224.tar.gz"
